import useTabsStore from "@/base/stores/modules/multipleTabs";
import useSettingStore from "@/base/stores/modules/setting";


/**
 *
 *  头部
 *
 * @author 徐寿春
 * 2023/5/19 18:10
 */


export default function useMultipleTabsManager() {
    const router = useRouter()
    const route = useRoute()
    const tabsStore = useTabsStore()
    const settingStore = useSettingStore()


    /**
     *  移除table标签
     * @author 徐寿春
     * 2023/4/4 23:58
     */
    const removeTab = () => {
        if (!settingStore.openMultipleTabs) return
        tabsStore.removeTab(route.fullPath, router)
    }


    return {
        removeTab
    }
}
